package com.ruoyi.web.service.impl;

import com.ruoyi.web.dto.FaultManagementDto;
import com.ruoyi.web.entity.FaultManagement;
import com.ruoyi.web.mapper.FaultManagementMapper;
import com.ruoyi.web.service.IFaultManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-01-30
 */
@Service
public class FaultManagementServiceImpl extends ServiceImpl<FaultManagementMapper, FaultManagement> implements IFaultManagementService {

    private final FaultManagementMapper faultManagementMapper;
    public FaultManagementServiceImpl(FaultManagementMapper faultManagementMapper){
        this.faultManagementMapper = faultManagementMapper;
    }
    /**
     * 查询故障管理
     *
     * @param id 故障管理主键
     * @return 故障管理
     */
    @Override
    public FaultManagementDto selectFaultManagementById(Long id)
    {
        return faultManagementMapper.selectFaultManagementById(id);
    }

    /**
     * 查询故障管理列表
     *
     * @param faultManagement 故障管理
     * @return 故障管理
     */
    @Override
    public List<FaultManagementDto> selectFaultManagementList(FaultManagement faultManagement)
    {
        return faultManagementMapper.selectFaultManagementList(faultManagement);
    }

    /**
     * 新增故障管理
     *
     * @param faultManagement 故障管理
     * @return 结果
     */
    @Override
    public int insertFaultManagement(FaultManagement faultManagement)
    {
        return faultManagementMapper.insertFaultManagement(faultManagement);
    }

    /**
     * 修改故障管理
     *
     * @param faultManagement 故障管理
     * @return 结果
     */
    @Override
    public int updateFaultManagement(FaultManagement faultManagement)
    {
        return faultManagementMapper.updateFaultManagement(faultManagement);
    }

    /**
     * 批量删除故障管理
     *
     * @param ids 需要删除的故障管理主键
     * @return 结果
     */
    @Override
    public int deleteFaultManagementByIds(Long[] ids)
    {
        return faultManagementMapper.deleteFaultManagementByIds(ids);
    }

    /**
     * 删除故障管理信息
     *
     * @param id 故障管理主键
     * @return 结果
     */
    @Override
    public int deleteFaultManagementById(Long id)
    {
        return faultManagementMapper.deleteFaultManagementById(id);
    }
}
